package com.slx.construct_string_from_binary_tree;

import org.junit.Assert;

public class SolutionTest {

    @org.junit.Test
    public void tree2str() {
        TreeNode root = new TreeNode(1);
        root.left = new TreeNode(2);
        root.right = new TreeNode(3);
        root.left.left = new TreeNode(4);

        Solution s = new Solution();
        Assert.assertEquals("1(2(4))(3)", s.tree2str(root));
    }

    @org.junit.Test
    public void tree2str2() {
        TreeNode root = new TreeNode(1);
        root.left = new TreeNode(2);
        root.right = new TreeNode(3);
        root.left.right = new TreeNode(4);

        Solution s = new Solution();
        Assert.assertEquals("1(2()(4))(3)", s.tree2str(root));
    }
}